#pragma once
#include <fstream>
#include <cstdlib>
#include <vector>
using namespace std;

#define VIEW_WIDTH 32
#define VIEW_HEIGHT 20

#include "Space.h"
#include "PropertyList.h"

class Board
{
private:
	vector<Space> m_spaces;
	int m_width, m_height;
	int m_x, m_y;
	char** m_map; 

	bool loadMap(char* a_filename);

	bool loadSpaces(char* a_filename, PropertyList* a_properties);
public:
	Board(int a_x, int a_y);

	bool loadFromFile(char* a_boardFilename, char* a_spacesFilename, PropertyList* a_properties);

	// Draw a portion of the board starting at (a_x, a_y)
	void drawPortion(int a_x, int a_y);

	void drawSpace(int a_space);

	int getWidth();
	int getHeight();

	int getPosX();
	int getPosY();

	int searchSpace(char* a_search, int a_start);

	Space* getSpace(int a_space);
};